<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/statics/layui/font/font.css" media="all"/>
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <style type="text/css">
        html, body {
            height: 100%;
        }
        .chooseBox {
            border: 1px solid #333;
            height: 300px;
            padding: 10px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            overflow-y: auto;
        }

        .leftBox > p {
            line-height: 30px;
            padding-left: 20px;
            cursor: pointer;
        }

        .leftBox > p:hover {
            background: #ddd;
        }

        .leftBox > p.selected {
            background: #d5d5d5;
        }
    </style>
</head>
<body>
<div class="layui-fluid" style="height:98%; margin-top: 10px;">
    <form class="layui-form" lay-filter="formData">
        <input type="hidden" name="userId" class="formData">
        <div class="layui-form-item">
            <label class="layui-form-label">邮件主题</label>
            <div class="layui-input-block">
                <input type="text" name="subject" id="subject" lay-verify="required" autocomplete="off" class="layui-input formData">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮件发送人</label>
            <div class="layui-input-block">
                <input type="text" name="sender" id="sender" lay-verify="required" autocomplete="off" class="layui-input formData">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮件接收人</label>
            <div class="layui-input-block">
                <input type="text" name="receiver" id="receiver" lay-verify="required" autocomplete="off" class="layui-input formData">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮件内容</label>
            <div class="layui-input-block">
                <div id="content"></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发送时间</label>
            <div class="layui-input-block">
                <input type="text"  name="sendDate" id="sendDate" lay-verify="required"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label ">发送状态</label>
            <div class="layui-input-block">
                <input type="text"  id="sendResult" lay-verify="required"   autocomplete="off" class="layui-input" >
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    layui.use(['form', 'sessionFun', 'configure', 'configureCom'], function () {
        window.$ = layui.$;
        var form = layui.form;
        var configure = layui.configure;;
        var sessionFun = layui.sessionFun;
        var listData = sessionFun.get(configure.SESSION_LIST_DATA);
        if (listData) {
            $('#content').html(listData.content);
            var sendResult=listData.sendResult;
            if(sendResult==0){

                $('#sendResult').val("发送成功");
            }else if(sendResult==1){
                $('#sendResult').val("发送失败");
            }else{
                $('#sendResult').val("发送中");
            }
            form.val('formData', listData);
        }
        form.render();

    });

    function getData() {
        var data = {};
        $('.formData').each(function (index, item) {
            var key = $(item).attr('name');
            data[key] = $(item).val();
        });
        return data;
    }
</script>
</body>
</html>
